package InputOutputStreamDemo;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;

public class PrintStreamDemo {
    public static void main(String[] args) {
        String readFilePath = "C:"+ File.separator+"Users"+File.separator+"Administrator"+File.separator+"Desktop"
                +File.separator+"1"+File.separator+"test.txt";
        File file = new File(readFilePath);

        try {
            PrintStream out = new PrintStream(new FileOutputStream(file));
            out.println(true);
            out.print("11111111111");
            out.print("2222222222");
            out.close();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
}
